
export const elementScale = {
    mounted(el, binding) {
        // el.style.transformOrigin = '10%';
        // el.style.transform = `scale(1,1)`;
        // el.style.transition = '0.5s';
    },
    // 这里的第二个参数同上面钩子的第二个参数一样，解构出来就是新旧值
    updated(el, { value, oldValue }) {
        if (value % 2 != 0) {
			el.style.position = 'flex';
			el.style.left = '0';
			el.style.top = '0';
			el.style.width = '50vmin';
			el.style.height = '50vmin';
			el.style.zIndex = '1';
        }else{
			el.style.position = 'absolute';
			el.style.left = '30px';
			el.style.top = '46px';
			el.style.width = '40px';
			el.style.height = '40px';
		}
    }
}
export const elementOpacity = {
    mounted(el, binding) {
        el.style.color = 'rgba(0,0,0,1)';
        el.style.transition = '0.5s';
    },
    // 这里的第二个参数同上面钩子的第二个参数一样，解构出来就是新旧值
    updated(el, { value, oldValue }) {
        if (value != oldValue) {
            el.style.color = 'rgba(0,0,0,0.01)';
            setTimeout(() => {
                el.style.color = 'rgba(0,0,0,1)';
            }, 500);
        }
    }
}
export const scroll = {
    mounted(el, binding) {
        el.addEventListener('scroll', binding.value);
    },
    unmounted(el, binding) {
        el.removeEventListener('scroll', binding.value);
    }
}
export const selectLoadMore = {
    mounted(el, binding) {
        // 获取element-ui定义好的scroll盒子
        const selectDom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
        console.log(selectDom);
        return
        selectDom.addEventListener('scroll', function () {
            // el.addEventListener('scroll', function () {
            if (this.scrollHeight - this.scrollTop < this.clientHeight + 1) {
                binding.value()
            }
        })
    }
}
